package org.raymond.iworks.study.basic.designpattern.prototype.improve;

import lombok.Getter;
import lombok.Setter;

/**
 * @author raymond
 * @version V1.0
 * @Description: TODO
 */
@Setter
@Getter
public class Sheep implements Cloneable {
    private String name;
    private int age;
    private String color;

    public Sheep(String name, int age, String color) {
        this.name = name;
        this.age = age;
        this.color = color;
    }

    @Override
    public String toString() {
        return "Sheep{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", color='" + color + '\'' +
                '}';
    }

    @Override
    protected Object clone() {
        Sheep sheep = null;
        try {
            sheep = (Sheep) super.clone();
        }catch (Exception e){
            System.err.println(e.getMessage());
        }
        return sheep;
    }
}
